import axios from 'axios'
const ERR_OK = 0
 const baseURL = process.env.NODE_ENV === 'production' ? 'http://ustbhuangyi.com/music-next/' : '/'
 axios.defaults.baseURL = baseURL
// 面向页面的接口

// axios.defaults.baseURL = 'http://localhost:9003'

export function get(url:string, params?:any) {
  console.log(url)
  return axios.get(url, {
    params
  }).then((res) => {
    // console.log(res.data)
    const serverData = res.data
    if (serverData.code === ERR_OK) {
      return serverData.result
    }
  }).catch((_e:any) => {
  })
}
